package com.baili.service.planner;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baili.dao.planner.PlannerDao;
import com.baili.dao.productionorder.ProductionOrderDao;
import com.baili.dto.ProductOrder;

/** 
 * @author iceX
 * @version 创建时间：2016年3月31日 下午2:53:05 
 * @Name: InspectorServiceImpl.java
 */
@Service
public class PlannerServiceImpl implements PlannerService{

	@Autowired
	private PlannerDao plannerDao;
	@Autowired
	private ProductionOrderDao productionOrderDao;
	
	SimpleDateFormat sdf = new SimpleDateFormat();
	
	@Override
	public List getProductOrderByRoundTypeP(ProductOrder productOrder){
		
		return plannerDao.getProductOrderByRoundTypeP(productOrder);
	}
	@Override
	public List getProductOrderByRoundTypeF(ProductOrder productOrder){
		
		return plannerDao.getProductOrderByRoundTypeF(productOrder);
	}
	@Override
	public List getProductOrderByRoundTypePSee(ProductOrder productOrder){
		
		return plannerDao.getProductOrderByRoundTypePSee(productOrder);
	}
	@Override
	public List getProductOrderByRoundTypeFSee(ProductOrder productOrder){
		
		return plannerDao.getProductOrderByRoundTypeFSee(productOrder);
	}
	
	@Override
	public List getProductOrderByRoundTypePWarning(ProductOrder productOrder){
		
		return plannerDao.getProductOrderByRoundTypePWarning(productOrder);
	}
	@Override
	public List getProductOrderByRoundTypeFWarning(ProductOrder productOrder){
		
		return plannerDao.getProductOrderByRoundTypeFWarning(productOrder);
	}


	@Override
	public List handleProductOrderByProductCode(ProductOrder productOrder) {
		
		
		return plannerDao.handleProductOrderByProductCode(productOrder);
	}
	@Override
	public List handleProductOrderByProductCodeSchedule(ProductOrder productOrder) {
		
		
		return plannerDao.handleProductOrderByProductCodeSchedule(productOrder);
	}


	@Override
	public List getBomList(ProductOrder productOrder) {
		
		return plannerDao.getBomList(productOrder);
	}


	@Override
	public List getNormedList(ProductOrder productOrder) {
		
		return plannerDao.getNormedList(productOrder);
	}


	@Override
	public List<Map<String, Object>> warning() {
		
		return plannerDao.warning();
	}
	@Override
	public int getCount() {
		
		return plannerDao.getCount();
	}

	@Override
	public List<Map<String,Object>> getListByOvertimeTypeP(ProductOrder productOrder) throws Exception{
		
		return plannerDao.getListByOvertimeTypeP(productOrder);
	}
	
	@Override
	public List<Map<String,Object>> getListByOvertimeTypeF(ProductOrder productOrder) throws Exception{
		
		return plannerDao.getListByOvertimeTypeF(productOrder);
	}
	@Override
	public List<Map<String,Object>> getListByOvertimeType(ProductOrder productOrder) throws Exception {
		
		return plannerDao.getListByOvertimeType(productOrder);
	}
	@Override
	public Map<String,Object> getTimeTypeListByTime(String startTime, String overTime) {
		
		return plannerDao.getTimeTypeListByTime(startTime,overTime);
	}
	
	/**
	 * 轮次制定(更新生产小组字段，更新轮次审核字段，以产品编码为条件对生产通知单表进行更新)
	 * @param ProductOrder
	 * @return
	 */
	@Override
	public void updateProductOrderPTeam(ProductOrder productOrder) {
		
		plannerDao.updateProductOrderPTeam(productOrder);
	}
	@Override
	public List getApprovalList(ProductOrder productOrder) {
		
		return plannerDao.getApprovalList(productOrder);
	}
	@Override
	public List getProductionOrderParam(ProductOrder productOrder) {
		
		return plannerDao.getProductionOrderParam(productOrder);
	}
	
	@Override
	public List<Map<String,Object>> getProcessName(ProductOrder productOrder) {
		
		return plannerDao.getProcessName(productOrder);
	}
	
	@Override
	public List getProductTeam(ProductOrder productOrder) {
		
		return plannerDao.getProductTeam(productOrder);
	}
	@Override
	public List getBLSize() {
		
		return plannerDao.getBLSize();
	}
	@Override
	public List getSizeBySex(Integer sex) {
		
		return plannerDao.getSizeBySex(sex);
	}
	@Override
	public List getWarningDetails(ProductOrder productOrder) {
		
		return plannerDao.getWarningDetails(productOrder);
	}
	@Override
	public void addProductOrder(ProductOrder productOrder) {
		
		productionOrderDao.insertProductionOrderByRoundAndSize(productOrder);
	}
	@Override
	public List getWarehouseAndWorkShop() {
		
		return plannerDao.getWarehouseAndWorkShop();
	}
}
